import pandas as pd


class DataOperationExcel:
    def __init__(self, path):
        self.data = pd.read_excel(path)

    # 转换列表嵌套字典
    def get_data_to_dict(self):
        # [{},{},{}]
        return [self.data.loc[i].to_dict() for i in self.data.index.values]

    # 转换列表嵌套列表
    def get_data_to_list(self):
        # [[],[],[]]
        return self.data.values.tolist()



